package com.crc.luojian.util;

import com.crc.luojian.annotation.Controller;
import org.reflections.Reflections;

import java.lang.annotation.Annotation;
import java.util.Set;

/**
 * @program: luojian-springframework
 * @description: 反射工具类
 * @author: luojian58
 * @create: 2021-06-10 15:25
 */
public class ReflectionUtils {
    private static final Reflections reflections = new Reflections("");
    // 通过注解类型获取所有的class 存入set 集合
    public static Set<Class<?>> getAllClass(Class<? extends Annotation> clazz) {
        Set<Class<?>> classSet = reflections.getTypesAnnotatedWith(clazz);
        return classSet;
    }
}
